package com.zjc.netty;

import com.zjc.netty.server.NettyServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

@SpringBootApplication
public class NettyApplication implements ApplicationRunner {

    @Autowired
    NettyServer nettyServer;

    public static void main(String[] args) {
        new SpringApplicationBuilder(NettyApplication.class)
                .web(WebApplicationType.NONE)
                .run(args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        nettyServer.start();
    }
}
